package datatypes.film;

public class Film {

	private String name;
	private String id;
	private String initial_release_date;
	private String directed_by;
	private String written_by;
	private String estimated_budget;
	private String starring;
	private String genre;
	private String sequel;
	private String prequel;

	private FilmBudget film_budget;

	public Film(String name, String id, String initial_release_date,
			String directed_by, String written_by, String estimated_budget,
			String starring, String genre, String sequel, String prequel) {

		this.name = name;
		this.id = id;
		this.initial_release_date = initial_release_date;
		this.directed_by = directed_by;
		this.written_by = written_by;
		this.estimated_budget = estimated_budget;
		this.starring = starring;
		this.genre = genre;
		this.sequel = sequel;
		this.prequel = prequel;
	}

	public void init(Film film) {
		this.name = film.getName();
		this.id = film.getId();
		this.initial_release_date = film.getInitial_release_date();
		this.directed_by = film.getDirected_by();
		this.written_by = film.getWritten_by();
		this.estimated_budget = film.getEstimated_budget();
		this.starring = film.getStarring();
		this.genre = film.getGenre();
		this.sequel = film.getSequel();
		this.prequel = film.getPrequel();
	}

	public Film() {

	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	public String getInitial_release_date() {
		return initial_release_date;
	}

	public void setInitial_release_date(String initial_release_date) {
		this.initial_release_date = initial_release_date;
	}

	public String getDirected_by() {
		return directed_by;
	}

	public void setDirected_by(String directed_by) {
		this.directed_by = directed_by;
	}

	public String getWritten_by() {
		return written_by;
	}

	public void setWritten_by(String written_by) {
		this.written_by = written_by;
	}

	public String getEstimated_budget() {
		return this.estimated_budget;
	}

	public void setEstimated_budget(String estimated_budget) {
		this.estimated_budget = estimated_budget;
	}

	public String getStarring() {
		return starring;
	}

	public void setStarring(String starring) {
		this.starring = starring;
	}

	public String getGenre() {
		return genre;
	}

	public void setGenre(String genre) {
		this.genre = genre;
	}

	public String getSequel() {
		return sequel;
	}

	public void setSequel(String sequel) {
		this.sequel = sequel;
	}

	public String getPrequel() {
		return prequel;
	}

	public void setPrequel(String prequel) {
		this.prequel = prequel;
	}

	public FilmBudget getFilm_budget() {
		return film_budget;
	}

	public void setFilm_budget(FilmBudget film_budget) {
		this.film_budget = film_budget;
		this.estimated_budget = film_budget.getBudget();
	}

	@Override
	public String toString() {

		StringBuilder sb = new StringBuilder();

		if (id != null && id.length() > 0) {
			sb.append("id: " + id + "\n");
		}

		if (name != null && name.length() > 0) {
			sb.append("name: " + name + "\n");
		}

		if (initial_release_date != null && initial_release_date.length() > 0) {
			sb.append("initial_release_date: " + initial_release_date + "\n");
		}

		if (directed_by != null && directed_by.length() > 0) {
			sb.append("directed_by: " + directed_by + "\n");
		}

		if (written_by != null && written_by.length() > 0) {
			sb.append("written_by: " + written_by + "\n");
		}

		if (estimated_budget != null && estimated_budget.length() > 0) {
			sb.append("estimated_budget: " + estimated_budget + "\n");
		}

		if (starring != null && starring.length() > 0) {
			sb.append("starring: " + starring + "\n");
		}

		if (genre != null && genre.length() > 0) {
			sb.append("genre: " + genre + "\n");
		}

		if (sequel != null && sequel.length() > 0) {
			sb.append("sequel: " + sequel + "\n");
		}

		if (prequel != null && prequel.length() > 0) {
			sb.append("prequel: " + prequel + "\n");
		}

		return sb.toString();

	}

}
